<%@ Page Language="C#" MasterPageFile="app-frame.master" AutoEventWireup="true" CodeFile="ReportWizard.aspx.cs"
    Inherits="ReportWizard" Title="ReportWizard" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" runat="Server">

    <script language="javascript" type="text/javascript">
    </script>

    <asp:Wizard ID="wz_Report" runat="server" Height="100%" Width="99%" OnFinishButtonClick="wizReport_FinishButtonClick"
        ActiveStepIndex="0" OnActiveStepChanged="wz_Report_ActiveStepChanged" OnCancelButtonClick="wz_Report_CancelButtonClick"
        OnNextButtonClick="wz_Report_NextButtonClick" OnPreviousButtonClick="wz_Report_PreviousButtonClick"
        CssClass="defaultFont" Font-Size="8pt" DisplayCancelButton="True" HeaderText="Report Wizard - Add">
        <WizardSteps>
            <asp:WizardStep runat="server" StepType="Start" Title="Report Details">
            <%--<script language="javascript" src="scripts/commonscript.js" type="text/javascript"></script>--%>
                <table style="width: 100%" border="0">
                    <tr style="width: 50px">
                        <td>
                        </td>
                        <td>
                            <asp:Label ID="Label12" runat="server" Font-Bold="True" CssClass="defaultFont" Font-Size="10pt"
                                Text="Report creation wizard - Step 1"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 20px">
                        </td>
                        <td style="height: 20px">
                            <asp:Label ID="Label11" runat="server" CssClass="defaultFont" Font-Size="8pt" Text="The wizard guides the user to create reports"></asp:Label>
                        </td>
                    </tr>
                </table>
                <table style="width: 100%; height: 70%" border="0">
                    <tr>
                        <td style="height: 20px; width: 4px;">
                        </td>
                        <td style="width: 118px; height: 20px">
                            <asp:Label ID="Label14" runat="server" ForeColor="Black"
                                Text="Report ID" Visible="False" CssClass="controlLabelFont"></asp:Label>
                        </td>
                        <td style="width: 300px">
                            <asp:TextBox ID="txt_Report_Id" runat="server" BorderColor="Gainsboro" BorderStyle="Solid" ReadOnly="True" Width="244px" Visible="False" CssClass="controlFont"></asp:TextBox>
                        </td>
                        <td style="width: 18px">
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 20px; width: 4px;">
                        </td>
                        <td style="width: 118px; height: 20px;">
                            <asp:Label ID="Label1" runat="server" ForeColor="Black"
                                Text="Report Name" CssClass="controlLabelFont"></asp:Label>
                        </td>
                        <!--  <td style="width: 9px"></td> -->
                        <td style="width: 300px;">
                            <asp:TextBox ID="txtReportName" runat="server" Width="244px"
                                BorderColor="Gainsboro" BorderStyle="Solid" TabIndex="1" CssClass="controlFont"></asp:TextBox>
                        </td>
                        <td style="width: 18px;">
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 21px; width: 4px;">
                        </td>
                        <td style="width: 118px; height: 21px">
                        </td>
                        <td style="width: 300px;">
                            <asp:RequiredFieldValidator ID="rqdReportName" runat="server" ControlToValidate="txtReportName"
                                Width="218px" Height="15px" Display="Dynamic" SetFocusOnError="True" Font-Size="8pt">Please enter a name for the report</asp:RequiredFieldValidator>
                        </td>
                        <td style="width: 18px;">
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 30px; width: 4px;">
                        </td>
                        <td style="width: 118px; height: 30px;">
                            <asp:Label ID="Label2" runat="server" ForeColor="Black"
                                Text="Report Description" CssClass="controlLabelFont"></asp:Label>
                        </td>
                        <td style="width: 241px; height: 30px;">
                            <asp:TextBox ID="txtReportDesc" runat="server"
                                Height="65px" TextMode="MultiLine" Width="244px" TabIndex="2" BorderColor="#E0E0E0"
                                BorderStyle="Solid" CssClass="controlFont"></asp:TextBox>
                        </td>
                        <td style="width: 18px; height: 30px;">
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 40px; width: 4px;">
                        </td>
                        <td style="width: 118px; height: 40px;">
                            <asp:Label ID="Label4" runat="server" ForeColor="Black"
                                Text="Report Type" CssClass="controlLabelFont"></asp:Label>
                        </td>
                        <td style="width: 241px; height: 40px;" colspan="1" valign="middle">
                            <table>
                                <tr>
                                    <td style="width: 234px">
                                        <asp:RadioButton ID="rbTabular" runat="server" Checked="True" ForeColor="Black" GroupName="ReportType" TabIndex="3" Text="Tabular"
                                            ValidationGroup="ReportType" OnCheckedChanged="rbTabular_CheckedChanged" CssClass="controlFont" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 234px;">
                                        <asp:RadioButton ID="rbMatrix" runat="server"
                                            ForeColor="Black" GroupName="ReportType" TabIndex="3" Text="Matrix" ValidationGroup="ReportType"
                                            OnCheckedChanged="rbMatrix_CheckedChanged" Visible="False" CssClass="controlFont" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 234px">
                                        <asp:RadioButton ID="rbMasterDetail" runat="server"
                                            ForeColor="Black" GroupName="ReportType" TabIndex="3" Text="Master-Detail" ValidationGroup="ReportType"
                                            Width="115px" OnCheckedChanged="rbMasterDetail_CheckedChanged" Visible="False" CssClass="controlFont" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td style="width: 18px; height: 40px;">
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 40px; width: 4px;">
                        </td>
                        <td style="width: 118px; height: 40px;">
                            <asp:Label ID="Label5" runat="server" ForeColor="Black"
                                Text="Report Object" CssClass="controlLabelFont"></asp:Label>
                        </td>
                        <td style="width: 241px; height: 40px;">
                            <table style="width: 244px">
                                <tr>
                                    <td style="width: 691px; height: 21px">
                                        <asp:RadioButton ID="rbPredefinedObjects" runat="server"
                                            ForeColor="Black" GroupName="ReportBase" TabIndex="4" Text="Choose from queries"
                                            ValidationGroup="ReportBase" OnCheckedChanged="rbPredefinedObjects_CheckedChanged" CssClass="controlFont" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 691px">
                                        <asp:RadioButton ID="rbAllObjects" runat="server"
                                            ForeColor="Black" GroupName="ReportBase" TabIndex="4" Text="Choose from objects"
                                            ValidationGroup="ReportBase" OnCheckedChanged="rbAllObjects_CheckedChanged" Checked="True" CssClass="controlFont" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td style="width: 18px; height: 40px;">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 4px;">
                        </td>
                        <td style="width: 118px;">
                            <asp:Label ID="Label16" runat="server" Text="Owner" CssClass="controlLabelFont"></asp:Label>
                        </td>
                        <td style="width: 241px;" id="tdownerid" runat="server">
                            <asp:TextBox ID="txt_owner_id" runat="server" CssClass="controlFont"></asp:TextBox>
                            <asp:Image ID="imgsearch" ToolTip="Click here for Lookup Window" runat="server" ImageUrl="~/Images/search.gif" CssClass="SearchPopup" />
                        </td>
                        <td style="width: 18px;">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 4px">
                        </td>
                        <td style="width: 118px">
                        </td>
                        <td runat="server" style="width: 241px">
                            
                            <asp:HiddenField ID="owner_id" runat="server" />
                        </td>
                        <td style="width: 18px">
                        </td>
                    </tr>
                </table>
            </asp:WizardStep>
            <asp:WizardStep runat="server" Title="Report Objects">
                <table style="width: 100%" border="0">
                    <tr>
                    <tr style="width: 50px">
                        <td style="width: 23px">
                        <td>
                            <asp:Label ID="Label13" runat="server" Font-Bold="True" CssClass="defaultFont" Font-Size="10pt"
                                Text="Report creation wizard - Step 2"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                    <tr style="width: 50px">
                        <td style="width: 23px;">
                        <td>
                            <asp:Label ID="lblMsgStep2" runat="server" CssClass="defaultFont" Font-Size="8pt"></asp:Label>
                        </td>
                    </tr>
                </table>
                <table style="width: 100%">
                    <tr>
                        <td style="width: 35px">
                        </td>
                        <td style="width: auto">
                            <table>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbl_Object" runat="server" ForeColor="Black"
                                            Text="Choose base object" CssClass="controlLabelFont"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="cmbObject" runat="server" CssClass="defaultFont" Font-Size="8pt"
                                            Width="205px" AutoPostBack="True" OnSelectedIndexChanged="cmbObject_SelectedIndexChanged"
                                            CausesValidation="True">
                                        </asp:DropDownList>
                                    </td>
                                    <td style="width: 1px">
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td style="width: 40px;">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 35px;">
                        </td>
                        <td style="width: auto;">
                            &nbsp;<asp:Label ID="lblDesc" runat="server" CssClass="defaultFont" Font-Size="8pt" Width="100%"></asp:Label>
                        </td>
                        <td style="width: 40px;">
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <table>
                                <tr>
                                    <td align="left">
                                        <asp:Label ID="Label6" runat="server" ForeColor="Black"
                                            Text="Choose the fields" CssClass="controlLabelFont"></asp:Label>
                                    </td>
                                    <td>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:ListBox ID="lstFields" runat="server" Height="150px" Width="245px" Font-Size="8pt">
                                        </asp:ListBox>
                                    </td>
                                    <td valign="middle">
                                        <table>
                                            <tr>
                                                <td>
                                                    <asp:ImageButton ID="imgSelectAll" runat="server" ImageUrl="Images/last.gif" OnClick="imgSelectAll_Click"
                                                        AlternateText="Select all fields" ToolTip="Select all fields" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:ImageButton ID="imgSelect" runat="server" ImageUrl="Images/front.gif" OnClick="imgSelect_Click"
                                                        AlternateText="Select field" ToolTip="Select field" />
                                                </td>
                                            </tr>
                                            <tr>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:ImageButton ID="imgUnselect" runat="server" ImageUrl="Images/back.gif" OnClick="imgUnselect_Click"
                                                        AlternateText="Deselect field" ToolTip="Deselect field" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:ImageButton ID="imgUnselectAll" runat="server" ImageUrl="Images/first.gif" OnClick="imgUnselectAll_Click"
                                                        AlternateText="Deselect all fields" ToolTip="Deselect all fields" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td align="left">
                                        <asp:ListBox ID="lstSelectedFields" runat="server" Height="150px" Width="245px" Font-Size="8pt">
                                        </asp:ListBox>
                                    </td>
                                    <td align="left">
                                        <table>
                                            <tr>
                                                <td style="width: 3px">
                                                    <asp:ImageButton ID="imgUp" runat="server" ImageUrl="Images/up.gif" OnClick="imgUp_Click"
                                                        AlternateText="Move up" ToolTip="Move up" />
                                                </td>
                                            </tr>
                                            <tr style="height: 5px">
                                            </tr>
                                            <tr>
                                                <td style="width: 3px">
                                                    <asp:ImageButton ID="imgDown" runat="server" ImageUrl="Images/down.gif" OnClick="imgDown_Click"
                                                        AlternateText="Move down" ToolTip="Move down" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 35px;">
                        </td>
                        <td style="width: 44px;">
                            <table style="width: 100%">
                                <tr>
                                    <td style="width: 20%;">
                                    </td>
                                    <td align="center" style="width: 80%; height: 21px;">
                                        <asp:Label ID="lblFieldsMsg" runat="server" ForeColor="Red" CssClass="defaultFont" Font-Size="8pt"
                                            Width="492px" EnableViewState="False"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td style="width: 40px;">
                        </td>
                    </tr>
                </table>
            </asp:WizardStep>
            <asp:WizardStep runat="server" Title="Field Properties">
                <table style="width: 100%" border="0">
                    <tr>
                    <tr style="width: 50px">
                        <td>
                            <asp:Label ID="Label15" runat="server" Font-Bold="True" CssClass="defaultFont" Font-Size="10pt"
                                Text="Report creation wizard - Step 3"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                    <tr style="width: 50px">
                        <td>
                            <asp:Label ID="lblMsgStep3" runat="server" CssClass="defaultFont" Font-Size="8pt"></asp:Label>
                        </td>
                    </tr>
                </table>
                <table style="width: 100%; height: auto" runat="server">
                    <tr runat="server">
                        <td style="width: auto;" runat="server">
                            <asp:Label ID="lblMessage" runat="server" Font-Bold="True" CssClass="defaultFont" Font-Size="8pt"
                                ForeColor="Black"></asp:Label>
                        </td>
                    </tr>
                    <tr runat="server">
                        <td style="width: auto" id="td_Field" runat="server">
                            <table style="width: 100%; height: 100%" border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td style="width: auto; height: 7px">
                                        <asp:Label ID="Label7" runat="server" ForeColor="Black"
                                            Text="Set the properties for the report" Width="269px" Font-Bold="False" CssClass="controlLabelFont"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 100%" valign="top">
                                        <table id="tblProperties" border="0" cellpadding="0" cellspacing="0" style="width: 100%"
                                            runat="server">
                                            <tr runat="server" style="height: 25px" class="Grid_Header">
                                                <td align="center" runat="server" style="height: 25px;" class="Grid_Header">
                                                    <asp:Label ID="Label8" runat="server" Text="Attribute Id"
                                                        Font-Bold="True" CssClass="controlLabelFont"></asp:Label>
                                                </td>
                                                <td align="center" runat="server" style="height: 25px;">
                                                    <asp:Label ID="Label9" runat="server" Text="Attribute Name"
                                                        Font-Bold="True" CssClass="controlLabelFont"></asp:Label>
                                                </td>
                                                <td align="center" runat="server">
                                                    <asp:Label ID="Label10" runat="server" Text="Caption"
                                                        Font-Bold="True" CssClass="controlLabelFont"></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                        <table id="Table1" border="0" cellpadding="0" cellspacing="0" style="width: 100%"
                                            runat="server">
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr runat="server">
                        <td align="right" style="width: auto" runat="server">
                            <asp:Button ID="btnView" runat="server" OnClick="btnView_Click" Text="View Report"
                                Font-Size="8pt" Visible="False" />
                            <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" UseSubmitBehavior="False"
                                Font-Size="8pt" Visible="False" />
                            <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Save" Font-Size="8pt"
                                Visible="False" />
                        </td>
                    </tr>
                </table>
            </asp:WizardStep>
            <asp:WizardStep runat="server" Title="View Report">
                <table style="width: 100%">
                    <tr style="font-size: 8pt;" class="defaultFont">
                        <td id="td_param" runat="server" align="center">
                        </td>
                    </tr>
                    <tr style="font-size: 8pt;" class="defaultFont">
                        <td runat="server" align="center">
                            <asp:Button ID="btn_Generate" runat="server" OnClick="btn_Generate_Click" Text="Generate Report"
                                Visible="False" UseSubmitBehavior="False" />
                        </td>
                    </tr>
                    <tr style="font-size: 8pt;" class="defaultFont">
                        <td>
                            <asp:Label ID="lblmessage2" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr style="font-size: 8pt;" class="defaultFont">
                    <td>
                        <asp:Label ID="lbFF" runat="server" Text="File Format : " CssClass="controlLabelFont"></asp:Label><asp:DropDownList ID="ddlFileFormat" CssClass="controlFont" runat="server" Width="120px" OnSelectedIndexChanged="ddlFileFormat_SelectedIndexChanged"
                            AutoPostBack="True" Font-Size="8pt">
                            <asp:ListItem>--Select a Format--</asp:ListItem>
                            <asp:ListItem Value="Excel">Excel</asp:ListItem>
                            <asp:ListItem>PDF</asp:ListItem>
                        </asp:DropDownList>&nbsp;
                        <asp:LinkButton ID="lnkExport" runat="server" OnClick="btnExport_Click" Enabled="False">Export</asp:LinkButton>&nbsp;
                        <asp:LinkButton ID="lnkPrint" runat="server" OnClick="lnkPrint_Click" Visible="False">Print</asp:LinkButton>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100%">
                            <rsweb:ReportViewer ID="rptViewer" runat="server" Font-Names="Verdana" Font-Size="8pt"
                                Height="380px" ShowRefreshButton="False" Width="100%" DocumentMapWidth="100%"
                                BorderStyle="Solid" ShowExportControls="False" SizeToReportContent="True">
                                <LocalReport EnableExternalImages="True">
                                    <DataSources>
                                        <rsweb:ReportDataSource DataSourceId="SqlDataSource1" Name="DataSet1" />
                                    </DataSources>
                                </LocalReport>
                                <ServerReport ReportServerUrl="" />
                            </rsweb:ReportViewer>
                        </td>
                    </tr>
                </table>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ProviderName="System.Data.SqlClient">
                </asp:SqlDataSource>
                <asp:ImageButton ID="imgNewWindow" runat="server" ImageUrl="Images/newWindow21.gif"
                    ToolTip="View report in a new window" OnClick="imgNewWindow_Click" CausesValidation="False"
                    Visible="False" />
                <asp:HiddenField ID="hfRName" runat="server" />
            </asp:WizardStep>
        </WizardSteps>
        <StepStyle VerticalAlign="Top" />
        <HeaderStyle CssClass="Grid_Header" Height="25px" HorizontalAlign="Left" />
        <NavigationStyle CssClass="displaygridbottom" Height="30px" />
        <StartNavigationTemplate>
            <asp:Button ID="StartNextButton" runat="server" CommandName="MoveNext" Text="Next" />
            <asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="Cancel" />
            &nbsp;
        </StartNavigationTemplate>
        <StepNavigationTemplate>
            <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
                Text="Previous" />
            <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" Text="Next" />
            <asp:Button ID="btnFinish" runat="server" OnClick="btnFinish_Click" Text="Finish" />
            <asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="Cancel" />
            &nbsp;&nbsp;
        </StepNavigationTemplate>
        <FinishNavigationTemplate>
            <asp:Button ID="FinishPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
                Text="Previous" />
            <asp:Button ID="FinishButton" runat="server" CommandName="MoveComplete" Text="Finish" />
            <asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="Cancel" />
            &nbsp;
        </FinishNavigationTemplate>
        <HeaderTemplate>
            <table style="width: 100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="center" class="pgForm_Title" colspan="1" style="width: 100%; height: 30px"
                        valign="middle">
                        <asp:Label ID="Label3" runat="server" Text="Report Wizard"></asp:Label></td>
                    <td class="Grid_Header" style="width: 25px; height: 30px">
                        <asp:ImageButton ID="imgNewWindow1" Visible="false" runat="server" ImageUrl="Images/newWindow21.gif"
                            ToolTip="View report in a new window" OnClick="imgNewWindow_Click" CausesValidation="False" />&nbsp;</td>
                </tr>
            </table>
        </HeaderTemplate>
    </asp:Wizard>
    <asp:HiddenField ID="hf_af_row_id" runat="server" />
</asp:Content>
